﻿#set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/install/${PROJECT_NAME})
message(">>>>>>>>>>>>>>>>> PROJECT WINDOWS INSTALL PROJECT: " ${PROJECT_NAME})
message(">>>>>>>>>>>>>>>>> PROJECT WINDOWS INSTALL PATH: " ${CMAKE_INSTALL_PREFIX})

if (NOT ${NS_EXPORT_LIB})
install(TARGETS ${PROJECT_NAME} 
       RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} 
       LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}
       ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}
)
else()
install(TARGETS NSProject
       RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/Libs/${TARGET_ABI} 
       LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Libs/${TARGET_ABI}
       ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/Libs/${TARGET_ABI}
)
endif()

#install(DIRECTORY ${DIR_LIB}/${TARGET_ABI} DESTINATION ${CMAKE_INSTALL_LIBDIR})
if (NOT ${NS_EXPORT_LIB})
    install(DIRECTORY ${DIR_ROOT}/Assets DESTINATION ${CMAKE_INSTALL_PREFIX})
else()
    install(DIRECTORY ${DIR_ROOT}/Assets DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources)
endif()

if( ${DEBUG_PROJECT_INTERNAL} )
    set(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/DebugProjects/${PROJECT_NAME})
    message(">>>>>>>>>>>>>>>>> PROJECT WINDOWS BINARY DIR IN DEBUG: " ${CMAKE_BINARY_DIR})
	install(DIRECTORY ${ENGINE_ROOT_PATH}/Assets/Shaders/GLSL_SRC DESTINATION ${CMAKE_INSTALL_PREFIX}/EngineAssets/Shaders)
    install(DIRECTORY ${ENGINE_ROOT_PATH}/Assets/Textures/ DESTINATION ${CMAKE_INSTALL_PREFIX}/EngineAssets/Textures)
    #INSTALL DEPENDENT DLL
    install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/../../Engine/ DESTINATION ${CMAKE_INSTALL_PREFIX})
    install(FILES ${CMAKE_BINARY_DIR}/NSProject.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
	install(DIRECTORY ${DIR_ROOT}/Libs/${TARGET_ABI}/ DESTINATION ${CMAKE_INSTALL_PREFIX})
else()
    if (NOT ${NS_EXPORT_LIB})
        message(">>>>>>>>>>>>>>>>> PROJECT WINDOWS DIR: " ${CMAKE_BINARY_DIR})
        install(DIRECTORY ${ENGINE_ROOT_PATH}/EngineAssets DESTINATION ${CMAKE_INSTALL_PREFIX})
	    #Install vlc plugins to install folder
        #INSTALL DEPENDENT LIB. ${DIR_LIB} IS NS ENGINE LIB
        install(DIRECTORY ${DIR_LIB}/${TARGET_ABI}/ DESTINATION ${CMAKE_INSTALL_PREFIX})
        install(FILES ${CMAKE_BINARY_DIR}/NSProject.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
	    install(DIRECTORY ${DIR_ROOT}/Libs/${TARGET_ABI}/ DESTINATION ${CMAKE_INSTALL_PREFIX})
    else()
        message(">>>>>>>>>>>>>>>>> PROJECT WINDOWS DIR IN EXPORT LIB: " ${CMAKE_BINARY_DIR})
        install(DIRECTORY ${ENGINE_ROOT_PATH}/Include DESTINATION ${CMAKE_INSTALL_PREFIX})
        install(DIRECTORY ${ENGINE_ROOT_PATH}/EngineAssets DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources)
	    #Install vlc plugins to install folder
	    install(DIRECTORY ${ENGINE_ROOT_PATH}/tools/vlc/plugins DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources)
        #INSTALL DEPENDENT LIB. ${DIR_LIB} IS NS ENGINE LIB
        install(DIRECTORY ${DIR_LIB}/${TARGET_ABI}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/Libs/${TARGET_ABI})
        install(FILES ${CMAKE_BINARY_DIR}/NSProject.dll DESTINATION ${CMAKE_INSTALL_PREFIX}/Libs/${TARGET_ABI})
	    install(DIRECTORY ${DIR_ROOT}/Libs/${TARGET_ABI}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/Libs/${TARGET_ABI})
    endif()
endif()

if( EXISTS "${PROJECT_SOURCE_DIR}/CMake/InstallWindowsCustom.cmake" )
	include(${PROJECT_SOURCE_DIR}/CMake/InstallWindowsCustom.cmake)
endif() 

